
import java.math.BigDecimal;

/*
 *Universidad del Valle de Guatemala
 * Algoritmos y estructuras de datos
 * Hoja de Trabajo # 1 
 * @author Diego Bran 08068
 * @author Juan Pablo Argueta 11033
 * 
 */
public class Frame_Radio extends javax.swing.JFrame {
    RadioJ radio;
    /**
     * Genera el frame de la radio
     */
    public Frame_Radio() {
        initComponents();
        radio = new RadioJ();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        despliegue = new javax.swing.JTextField();
        adelantar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        label = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jButton7 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        salvar6 = new javax.swing.JButton();
        salvar3 = new javax.swing.JButton();
        salvar2 = new javax.swing.JButton();
        salvar1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        salvar5 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        salvar4 = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jButton8 = new javax.swing.JButton();
        desp4 = new javax.swing.JButton();
        desp2 = new javax.swing.JButton();
        desp5 = new javax.swing.JButton();
        desp6 = new javax.swing.JButton();
        desp1 = new javax.swing.JButton();
        desp3 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jButton12 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        jP_Frec = new javax.swing.JPanel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        despliegue.setBackground(new java.awt.Color(0, 0, 0));
        despliegue.setEditable(false);
        despliegue.setForeground(new java.awt.Color(0, 255, 51));
        despliegue.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                despliegueActionPerformed(evt);
            }
        });

        adelantar.setText("Siguiente>");
        adelantar.setEnabled(false);
        adelantar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                adelantarActionPerformed(evt);
            }
        });

        label.setText("Frecuencia:");

        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Guardar Estación"));

        jButton7.setText("12");
        jButton7.setEnabled(false);
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jButton6.setText("11");
        jButton6.setEnabled(false);
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        salvar6.setText("6");
        salvar6.setEnabled(false);
        salvar6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salvar6ActionPerformed(evt);
            }
        });

        salvar3.setText("3");
        salvar3.setEnabled(false);
        salvar3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salvar3ActionPerformed(evt);
            }
        });

        salvar2.setText("2");
        salvar2.setEnabled(false);
        salvar2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salvar2ActionPerformed(evt);
            }
        });

        salvar1.setText("1");
        salvar1.setEnabled(false);
        salvar1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salvar1ActionPerformed(evt);
            }
        });

        jButton2.setText("7");
        jButton2.setEnabled(false);
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("8");
        jButton3.setEnabled(false);
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setText("9");
        jButton4.setEnabled(false);
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        salvar5.setText("5");
        salvar5.setEnabled(false);
        salvar5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salvar5ActionPerformed(evt);
            }
        });

        jButton5.setText("10");
        jButton5.setEnabled(false);
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        salvar4.setText("4");
        salvar4.setEnabled(false);
        salvar4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salvar4ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jButton2, 0, 1, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, salvar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton3, 0, 1, Short.MAX_VALUE)
                    .add(salvar2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 47, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton4, 0, 1, Short.MAX_VALUE)
                    .add(salvar3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 43, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton5, 0, 1, Short.MAX_VALUE)
                    .add(salvar4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton6, 0, 1, Short.MAX_VALUE)
                    .add(salvar5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton7, 0, 1, Short.MAX_VALUE)
                    .add(salvar6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(salvar1)
                    .add(salvar2)
                    .add(salvar3)
                    .add(salvar4)
                    .add(salvar5)
                    .add(salvar6))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jButton2)
                    .add(jButton3)
                    .add(jButton4)
                    .add(jButton5)
                    .add(jButton6)
                    .add(jButton7))
                .addContainerGap())
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Seleccionar Estación"));

        jButton8.setText("7");
        jButton8.setEnabled(false);
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        desp4.setText("4");
        desp4.setEnabled(false);
        desp4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                desp4ActionPerformed(evt);
            }
        });

        desp2.setText("2");
        desp2.setEnabled(false);
        desp2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                desp2ActionPerformed(evt);
            }
        });

        desp5.setText("5");
        desp5.setEnabled(false);
        desp5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                desp5ActionPerformed(evt);
            }
        });

        desp6.setText("6");
        desp6.setEnabled(false);
        desp6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                desp6ActionPerformed(evt);
            }
        });

        desp1.setText("1");
        desp1.setEnabled(false);
        desp1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                desp1ActionPerformed(evt);
            }
        });

        desp3.setText("3");
        desp3.setEnabled(false);
        desp3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                desp3ActionPerformed(evt);
            }
        });

        jButton13.setText("12");
        jButton13.setEnabled(false);
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        jButton11.setText("10");
        jButton11.setEnabled(false);
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        jButton12.setText("11");
        jButton12.setEnabled(false);
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        jButton9.setText("8");
        jButton9.setEnabled(false);
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jButton10.setText("9");
        jButton10.setEnabled(false);
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jButton8, 0, 1, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, desp1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton9, 0, 1, Short.MAX_VALUE)
                    .add(desp2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 47, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton10, 0, 1, Short.MAX_VALUE)
                    .add(desp3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 43, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton11, 0, 1, Short.MAX_VALUE)
                    .add(desp4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton12, 0, 1, Short.MAX_VALUE)
                    .add(desp5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 44, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(jButton13, 0, 1, Short.MAX_VALUE)
                    .add(desp6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 45, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(desp1)
                    .add(desp2)
                    .add(desp3)
                    .add(desp4)
                    .add(desp5)
                    .add(desp6))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jButton8)
                    .add(jButton9)
                    .add(jButton10)
                    .add(jButton11)
                    .add(jButton12)
                    .add(jButton13))
                .addContainerGap(17, Short.MAX_VALUE))
        );

        jP_Frec.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createTitledBorder(""), "Banda"));

        buttonGroup1.add(jRadioButton1);
        jRadioButton1.setSelected(true);
        jRadioButton1.setText("FM");
        jRadioButton1.setEnabled(false);
        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton1ActionPerformed(evt);
            }
        });

        buttonGroup1.add(jRadioButton2);
        jRadioButton2.setText("AM");
        jRadioButton2.setEnabled(false);
        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton2ActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jP_FrecLayout = new org.jdesktop.layout.GroupLayout(jP_Frec);
        jP_Frec.setLayout(jP_FrecLayout);
        jP_FrecLayout.setHorizontalGroup(
            jP_FrecLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jP_FrecLayout.createSequentialGroup()
                .addContainerGap()
                .add(jP_FrecLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jRadioButton1)
                    .add(jRadioButton2))
                .addContainerGap(9, Short.MAX_VALUE))
        );
        jP_FrecLayout.setVerticalGroup(
            jP_FrecLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jP_FrecLayout.createSequentialGroup()
                .add(jRadioButton1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jRadioButton2))
        );

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 51, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(layout.createSequentialGroup()
                                .add(label)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(despliegue, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(adelantar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 109, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(layout.createSequentialGroup()
                                .add(183, 183, 183)
                                .add(jLabel1))
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .add(jP_Frec, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(30, 30, 30))))
                    .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(11, 11, 11)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(layout.createSequentialGroup()
                        .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 49, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(despliegue, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(label))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(adelantar))
                    .add(jP_Frec, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jLabel1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void adelantarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_adelantarActionPerformed
        radio.cambiarFrecuencia();
        despliegue.setText(""+radio.getFrecuencia());
    }//GEN-LAST:event_adelantarActionPerformed

    private void salvar1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salvar1ActionPerformed
        radio.guardarEstacion(1);
    }//GEN-LAST:event_salvar1ActionPerformed

    private void desp1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_desp1ActionPerformed
        radio.seleccionarEstacion(1);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_desp1ActionPerformed

    private void salvar2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salvar2ActionPerformed
        radio.guardarEstacion(2);
    }//GEN-LAST:event_salvar2ActionPerformed

    private void desp2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_desp2ActionPerformed
        radio.seleccionarEstacion(2); 
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_desp2ActionPerformed

    private void salvar3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salvar3ActionPerformed
        radio.guardarEstacion(3);
    }//GEN-LAST:event_salvar3ActionPerformed

    private void desp3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_desp3ActionPerformed
        radio.seleccionarEstacion(3);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_desp3ActionPerformed

    private void salvar4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salvar4ActionPerformed
        radio.guardarEstacion(4);
    }//GEN-LAST:event_salvar4ActionPerformed

    private void desp4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_desp4ActionPerformed
        radio.seleccionarEstacion(4);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_desp4ActionPerformed

    private void salvar5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salvar5ActionPerformed
        radio.guardarEstacion(5);
    }//GEN-LAST:event_salvar5ActionPerformed

    private void desp5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_desp5ActionPerformed
        radio.seleccionarEstacion(5);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_desp5ActionPerformed

    private void salvar6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salvar6ActionPerformed
        radio.guardarEstacion(6);
    }//GEN-LAST:event_salvar6ActionPerformed

    private void desp6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_desp6ActionPerformed
        radio.seleccionarEstacion(6);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_desp6ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        if (radio.isOn()){
            despliegue.setText("");
        } else {
            this.jRadioButton1.setSelected(radio.isFM());
            this.jRadioButton2.setSelected(radio.isAM());
            this.despliegue.setText(""+radio.getFrecuencia());
        }
        radio.onOff();
        this.adelantar.setEnabled(radio.isOn());
        this.desp1.setEnabled(radio.isOn());
        this.desp2.setEnabled(radio.isOn());
        this.desp3.setEnabled(radio.isOn());
        this.desp4.setEnabled(radio.isOn());
        this.desp5.setEnabled(radio.isOn());
        this.desp6.setEnabled(radio.isOn());
        this.salvar1.setEnabled(radio.isOn());
        this.salvar2.setEnabled(radio.isOn());
        this.salvar3.setEnabled(radio.isOn());
        this.salvar4.setEnabled(radio.isOn());
        this.salvar5.setEnabled(radio.isOn());
        this.salvar6.setEnabled(radio.isOn());
        this.jButton2.setEnabled(radio.isOn());
        this.jButton3.setEnabled(radio.isOn());
        this.jButton4.setEnabled(radio.isOn());
        this.jButton5.setEnabled(radio.isOn());
        this.jButton6.setEnabled(radio.isOn());
        this.jButton7.setEnabled(radio.isOn());
        this.jButton8.setEnabled(radio.isOn());
        this.jButton9.setEnabled(radio.isOn());
        this.jButton10.setEnabled(radio.isOn());
        this.jButton11.setEnabled(radio.isOn());
        this.jButton12.setEnabled(radio.isOn());
        this.jButton13.setEnabled(radio.isOn());
        this.jRadioButton1.setEnabled(radio.isOn());
        this.jRadioButton2.setEnabled(radio.isOn());
    }//GEN-LAST:event_jButton1ActionPerformed

    private void despliegueActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_despliegueActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_despliegueActionPerformed

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
        if (radio.isAM()){
            radio.cambiarBanda();
            this.despliegue.setText(""+radio.getFrecuencia());
        } 
    }//GEN-LAST:event_jRadioButton1ActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
        if (radio.isFM()){
            radio.cambiarBanda();
            this.despliegue.setText(""+radio.getFrecuencia());
        }
    }//GEN-LAST:event_jRadioButton2ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        radio.guardarEstacion(7);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        radio.guardarEstacion(8);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        radio.guardarEstacion(9);
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        radio.guardarEstacion(10);
    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        radio.guardarEstacion(11);
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        radio.guardarEstacion(12);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        radio.seleccionarEstacion(7);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        radio.seleccionarEstacion(8);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        radio.seleccionarEstacion(9);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_jButton10ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        radio.seleccionarEstacion(10);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_jButton11ActionPerformed

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
        radio.seleccionarEstacion(11);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_jButton12ActionPerformed

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        radio.seleccionarEstacion(12);
        despliegue.setText(""+radio.getFrecuencia());
        this.jRadioButton1.setSelected(radio.isFM());
        this.jRadioButton2.setSelected(radio.isAM());   
    }//GEN-LAST:event_jButton13ActionPerformed

   
    
    
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Frame_Radio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Frame_Radio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Frame_Radio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Frame_Radio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Frame_Radio().setVisible(true);
            }
        });
        
        
       
        
    
        
        
        
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton adelantar;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton desp1;
    private javax.swing.JButton desp2;
    private javax.swing.JButton desp3;
    private javax.swing.JButton desp4;
    private javax.swing.JButton desp5;
    private javax.swing.JButton desp6;
    private javax.swing.JTextField despliegue;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jP_Frec;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JLabel label;
    private javax.swing.JButton salvar1;
    private javax.swing.JButton salvar2;
    private javax.swing.JButton salvar3;
    private javax.swing.JButton salvar4;
    private javax.swing.JButton salvar5;
    private javax.swing.JButton salvar6;
    // End of variables declaration//GEN-END:variables

}
